package com.koalton.steward.common.dto;

/**
 * Created by koalton on 2017/7/16.
 */
public class ResponseResult {


    String msg;
    ReponseResultCode result ;

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public ReponseResultCode getResult() {
        return result;
    }

    public void setResult(ReponseResultCode result) {
        this.result = result;
    }

    @Override
    public String toString() {
        return "ResponseResult{" +
                "msg='" + msg + '\'' +
                ", result=" + result +
                '}';
    }

    /**
     * 获得成功的响应对象
     * @return 成功响应对象
     */
    public static ResponseResult success(){
        ResponseResult result = new ResponseResult();
        result.setResult(ReponseResultCode.SUCCESS);
        result.setMsg("Success");
        return  result;
    }

    /**
     * 获得失败响应对象
     * @return 失败响应对象
     */
    public static ResponseResult failure(){
        ResponseResult result = new ResponseResult();
        result.setResult(ReponseResultCode.FAILURE);
        return  result;
    }
}
